IF exists(SELECT * FROM dbo.sysobjects WHERE name='R_maandRapportCijfers2' AND xtype='FN') 
BEGIN
	DROP FUNCTION R_maandRapportCijfers2
END
GO

CREATE      function R_maandRapportCijfers2
(@klas varchar(5))
returns table
as
return(
select * from r_maandCijfersVoorRapport
where klas = @klas and not vakcode like 'SE'
                     and not( vakcode like 'ES')
                      and not( vakcode like 'KV')
)